<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        const str = 'abc'
        console.log(str.padStart(5,'1')) // 11abc
        console.log(str.padStart(6,'13'),'str') //131abc
        console.log(str.padStart(1,'13'),'str') //abc
        console.log(str.padStart(6,'151312121'),'str') //151abc


        console.log(str.padEnd(5,'1')) // abc11
        console.log(str.padEnd(6,'13'),'str') //abc131
        console.log(str.padEnd(1,'13'),'str') //abc
        console.log(str.padEnd(6,'151312121'),'str') //abc151
    </script>
</body>
</html>